package com.wms.function.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wms.function.mapper.TbInventoryHistoryMapper;
import com.wms.function.domain.TbInventoryHistory;
import com.wms.function.service.ITbInventoryHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;

/**
 * 库存操作记录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class TbInventoryHistoryServiceImpl extends ServiceImpl<TbInventoryHistoryMapper,TbInventoryHistory> implements ITbInventoryHistoryService {
    @Autowired
    private TbInventoryHistoryMapper tbInventoryHistoryMapper;

    /**
     * 查询库存操作记录
     *
     * @param id 库存操作记录主键
     * @return 库存操作记录
     */
    @Override
    public TbInventoryHistory selectTbInventoryHistoryById(Long id) {
                return getById(id);
    }

    /**
     * 查询库存操作记录列表
     *
     * @param tbInventoryHistory 库存操作记录
     * @return 库存操作记录
     */
    @Override
    public List<TbInventoryHistory> selectTbInventoryHistoryList(TbInventoryHistory tbInventoryHistory) {
        return tbInventoryHistoryMapper.selectTbInventoryHistoryList(tbInventoryHistory);
    }

    /**
     * 新增库存操作记录
     *
     * @param tbInventoryHistory 库存操作记录
     * @return 结果
     */
    @Override
    public int insertTbInventoryHistory(TbInventoryHistory tbInventoryHistory) {
                                                                return save(tbInventoryHistory) ? 1 : 0;
    }

    /**
     * 修改库存操作记录
     *
     * @param tbInventoryHistory 库存操作记录
     * @return 结果
     */
    @Override
    public int updateTbInventoryHistory(TbInventoryHistory tbInventoryHistory) {
                                                        return updateById(tbInventoryHistory) ? 1 : 0;
    }

    /**
     * 批量删除库存操作记录
     *
     * @param ids 需要删除的库存操作记录主键
     * @return 结果
     */
    @Override
    public int deleteTbInventoryHistoryByIds(Long[] ids) {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除库存操作记录信息
     *
     * @param id 库存操作记录主键
     * @return 结果
     */
    @Override
    public int deleteTbInventoryHistoryById(Long id) {
                return removeById(id) ? 1 : 0;
    }

}
